use std::{env, process};
use grep_rust::Config;

fn main() {
    let config = Config::build(env::args())
        .unwrap_or_else(|err| {
            eprintln!("Problem parsing arguments: {}", err);
            process::exit(1);
        });

    // println!("query: {}", config.query);
    // println!("file_path: {}", config.file_path);

    if let Err(e) = grep_rust::run(config){
        eprintln!("Application error: {}", e);
        process::exit(1)
    };
}